//
//  hyTabBarController.m
//  anjuke
//
//  Created by jim Yao on 16/1/1.
//  Copyright © 2016年 anjuke. All rights reserved.
//

#import "hyTabBarController.h"
#import "hyHomeTableViewController.h"
#import "hyWeiTalkController.h"
#import "hyRecommendController.h"
#import "hyMineController.h"
#import "UIImage+render.h"

@interface hyTabBarController ()

@end

@implementation hyTabBarController

+(void)load{
    UITabBarItem *item = [UITabBarItem appearanceWhenContainedIn:self, nil];
    NSMutableDictionary *dic = [NSMutableDictionary dictionary];
    dic[NSForegroundColorAttributeName] = [UIColor colorWithRed:94/255.0 green:166/255.0 blue:0 alpha:1];
    
    [item setTitleTextAttributes:dic forState:UIControlStateSelected];
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setUpAllController];
    
    [self setUpTabbar];
    
    }

- (void)setUpAllController{
    /**
     主页
     */
    hyHomeTableViewController *homeVC= [[hyHomeTableViewController alloc] init];
    
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:homeVC];
    
    [self addChildViewController:nav];

    
    hyWeiTalkController *weiTalkVC = [[hyWeiTalkController alloc] init];
    UINavigationController *nav1= [[UINavigationController alloc]initWithRootViewController:weiTalkVC];
    [self addChildViewController:nav1];
    
    hyRecommendController *recommodVC = [[hyRecommendController alloc] init];
    UINavigationController *nav2= [[UINavigationController alloc]initWithRootViewController:recommodVC ];
    [self addChildViewController:nav2];
    
//    hyMineController *mineVC = [[hyMineController alloc] initWithNibName:@"hyMineController" bundle:nil];
    
    hyMineController *mineVC = [[hyMineController alloc] init];
    UINavigationController *nav3= [[UINavigationController alloc]initWithRootViewController:mineVC];
    [self addChildViewController:nav3];

    
}

- (void)setUpChildViewController{
    
    
    
}

- (void)setUpTabbar{
    
   UINavigationController *nav = self.childViewControllers[0];
    nav.tabBarItem.title = @"首页";
    nav.tabBarItem.image =[UIImage imageWithrenderName:@"comm_hometab_icon_house.png.base.universal.regular.off.horizontal.normal.active.onepartscale.onepart.33747.000.00.@1x"];
    nav.tabBarItem.selectedImage =[UIImage imageWithrenderName:@"comm_hometab_icon_house_slt.png.base.universal.regular.off.horizontal.normal.active.onepartscale.onepart.59369.000.00.@1x"];
    
    UINavigationController *nav1 = self.childViewControllers[1];
    nav1.tabBarItem.title = @"微聊";
    nav1.tabBarItem.image =[UIImage imageWithrenderName:@"comm_hometab_icon_chat@2x.png.base.universal.regular.off.horizontal.normal.active.onepartscale.onepart.60550.000.00."];
    nav1.tabBarItem.selectedImage =[UIImage imageWithrenderName:@"comm_hometab_icon_chat_selected@2x.png.base.universal.regular.off.horizontal.normal.active.onepartscale.onepart.21760.000.00."];
    
    UINavigationController *nav2 = self.childViewControllers[2];
    nav2.tabBarItem.title = @"推荐";
    nav2.tabBarItem.image =[UIImage imageWithrenderName:@"comm_hometab_icon_focus@2x.png.base.universal.regular.off.horizontal.normal.active.onepartscale.onepart.17387.000.00."];
    nav2.tabBarItem.selectedImage =[UIImage imageWithrenderName:@"comm_hometab_icon_focus_slt@2x.png.base.universal.regular.off.horizontal.normal.active.onepartscale.onepart.65223.000.00."];

    UINavigationController *nav3 = self.childViewControllers[3];
    nav3.tabBarItem.title = @"我的";
    nav3.tabBarItem.image =[UIImage imageWithrenderName:@"comm_hometab_icon_my@2x.png.base.universal.regular.off.horizontal.normal.active.onepartscale.onepart.16645.000.00."];
    nav3.tabBarItem.selectedImage =[UIImage imageWithrenderName:@"comm_hometab_icon_my_slt@2x.png.base.universal.regular.off.horizontal.normal.active.onepartscale.onepart.32315.000.00."];
    
}
@end


















